8  Variables, expression and statements: R

8.1 Data Types

Some of the commonly used objects in R are numbers - integer and double (or numeric), character and logical (TRUE/FALSE). The data type of the object can be identified using the in-built R function class(). For example, see the following objects and their types:

class(4)
[1] "numeric"
class(4.4)
[1] "numeric"
class('4')
[1] "character"
class(TRUE)
[1] "logical"

8.2 Variable names